/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author william
 */
public class Conexao {
    public static Connection getConexao() throws SQLException {
        try {
            Class.forName("com.mysql.jdbc.Driver");
              return DriverManager.getConnection("jdbc:mysql://localhost/estagio", "root", "annynha");
        } catch (ClassNotFoundException e) {
            throw new SQLException(e.getMessage());
        }
    }
    public static  void main(String[]args){
        try{
            getConexao();
            System.out.println("conectado com o banco!");
           
        }catch(SQLException e){
            System.out.println("erro ao conectar com banco");
        }
    }
}
